package com.yungu.swift.admin.route.system;

import com.alibaba.dubbo.config.annotation.Reference;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.base.model.PageVo;
import com.yungu.swift.common.model.dto.CommonVersionDto;
import com.yungu.swift.common.model.param.AdminIosVersionPageParam;
import com.yungu.swift.common.model.param.AdminIosVersionParam;
import com.yungu.swift.common.service.CommonVersionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : cuixiuyin
 * @date : 2019/6/15
 */
@RestController
@RequestMapping("/admin/v1/system/version/ios")
@Api(value = "【系统服务】", tags = "IOS版本管理")
public class IosVersionAdmin {

    @Reference
    private CommonVersionService commonVersionService;

    @RequestMapping(value = "/queryPage", method = RequestMethod.POST)
    @ApiOperation(value = "ios版本管理信息分页查询", httpMethod = "POST")
    public ResponseData<PageVo<CommonVersionDto>> queryPage(@RequestBody AdminIosVersionPageParam iosVersionPageParam) {
        return commonVersionService.queryPage(iosVersionPageParam);
    }

    @RequestMapping(value = "/saveOrUpdate", method = RequestMethod.POST)
    @ApiOperation(value = "ios版本管理信息新增或更新", httpMethod = "POST")
    public ResponseData<Boolean> saveOrUpdate(@RequestBody AdminIosVersionParam iosVersionParam) {
        return commonVersionService.saveOrUpdate(iosVersionParam);
    }
}
